﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Webdiyer.WebControls.Mvc;

namespace Web.Controllers
{
    public class AboutController : Controller
    {
        private readonly Manager.BLL.Admin.M_AboutBll bllAbout = new Manager.BLL.Admin.M_AboutBll();
        //
        // GET: /About/

        public ActionResult Index(int? page)
        {
            PagedList<Manager.Model.Admin.M_About> abouts = new PagedList<Manager.Model.Admin.M_About>(bllAbout.GetModelList("IsValid=1"), page ?? 1, 10);
            return View(abouts);
        }

        /// <summary>
        /// 相关资料明细
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(int? id)
        {
            int aboutid = id ?? 0;
            if (bllAbout.Exists(aboutid))
            {
                return View(bllAbout.GetModel(aboutid));
            }
            else
                return View();
        }
    }
}
